package app_kvServer;

import java.io.IOException;
import logger.LogSetup;
import org.apache.log4j.Level;

public class KVServer extends Thread {

	/**
	 * Constructs a KV Server at given port
	 * 
	 * @param port
	 *            given port for storage server to operate
	 */

	public KVServer(int port) {
		new SockServer(port).start();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			new LogSetup("logs/server/server.log", Level.ALL);
			new KVServer(50000);

		} catch (IOException e) {
			System.out.println("Error! Unable to initialize logger!");
			e.printStackTrace();
			System.exit(1);
		} catch (NumberFormatException nfe) {
			System.out.println("Error! Invalid argument <port>! Not a number!");
			System.out.println("Usage: Server <port>!");
			System.exit(1);
		}
	}

}
